package com.ngc.mall.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ngc.mall.common.configure.mybatisPlus.BaseServiceImpl;
import com.ngc.mall.domain.ArticleDomain;
import com.ngc.mall.mapper.ArticleMapper;
import com.ngc.mall.service.IArticleService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 *
 * 文章实现类
 * @author: chenxiaolin
 * @date 2023/9/16 16:26
**/
@Service
public class ArticleServiceImpl extends BaseServiceImpl<ArticleMapper, ArticleDomain> implements IArticleService {
    @Override
    public List<ArticleDomain> selectAll() {
        return super.list();
    }

    @Override
    public Long createArticle(ArticleDomain domain) {
        return super.create(domain);
    }

    @Override
    public Boolean updateById(Long id, ArticleDomain domain) {
        return super.update(domain, Wrappers.<ArticleDomain>lambdaQuery().eq(ArticleDomain::getId,id));
    }

    @Override
    public Boolean deleteById(Long id) {
        return super.removeById(id);
    }

    @Override
    public ArticleDomain getDetailById(Long id) {
        return super.getById(id);
    }
}
